package com.example.AoUserApp.controller;

import javafx.fxml.FXML;
import javafx.scene.control.TextArea;

import java.io.BufferedReader;
import java.io.IOException;

/**
 * @author:xec
 * @date:2022/9/7 10:44
 **/
public class EngineeringModeController {

    @FXML
    private TextArea terminalTA;

    public void listenServer(BufferedReader reader,TextArea terminalTA){
        while (true){
            String s = null;
            try {
                s = reader.readLine();
                if (s!=null&&!s.equals("end")){
                    terminalTA.appendText(s+'\n'+">");
                }
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
    }
}
